<?php
/**
 * JoiGallery - image gallery component for Joostina
 *
 * Менеджер категорий
 *
 * @version 1.0 alpha 3
 * @package JoiGallery
 * @subpackage	AdminView
 * @filename category_list.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2009 Joostina Team
 * @license see license.txt
 *
 **/
 
defined('_VALID_MOS') or die();


?>

	 <form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
		  <th class="categories"><?php echo _C_JOIGALLERY_CAT_MANAGER ?></th>
		  <td nowrap="nowrap"><?php echo _C_JOIGALLERY_CAT ?><?php echo $lists['cid']; ?></td>
	  </tr>
	  </table>
	  <table class="adminlist">
		<tr>
			<th width="10" align="left">#</th>
			<th width="20"><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows );?>);" /></th>
			<th class="title"><?php echo _C_JOIGALLERY_CAT_NAME ?></th>
			<th width="10%"><?php echo _C_JOIGALLERY_CAT_PUB ?></th>
			<th colspan="2" width="5%"><?php echo _C_JOIGALLERY_CAT_REORDER ?></th>
			<th width="2%"><?php echo _C_JOIGALLERY_CAT_ORDER ?></th>
			<th width="1%"><a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a></th>
			<th width="5%" nowrap><?php echo _C_JOIGALLERY_CAT_ID ?></th>
			<th width="20%"></th>
		</tr>
		<?php
		$k = 0;
		for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row 	= &$rows[$i];

			$link = 'index2.php?option='. $option . '&act=categories&task=edit&hidemainmenu=1&cid='. $row->id;
			$row->name = $row->treename;
			$checked 	= mosCommonHTML::CheckedOutProcessing( $row, $i );
			$published 	= mosCommonHTML::PublishedProcessing( $row, $i );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $pageNav->rowNumber( $i ); ?></td>
				<td><?php echo $checked; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo stripslashes( $row->name ) .' ( '. stripslashes( $row->title ) .' )'; ?> </a></td>
				<td align="center"><?php echo $published;?></td>
				<td><?php echo $pageNav->orderUpIcon( $i ); ?></td>
				<td><?php echo $pageNav->orderDownIcon( $i, $n ); ?></td>
				<td align="center" colspan="2"><input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" /></td>
				<td align="center"><?php echo $row->id; ?></td>
				<td></td>				
				<?php
				$k = 1 - $k;
				?>
			</tr>
			<?php
		}
		?>
		</table>

		<?php echo $pageNav->getListFooter(); ?>

		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="act" value="categories" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>